﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Nivdal.Sponsors
{
    public partial class SponsorMaster : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string ChildPageName = "";
            if (Page.Page != null)
                ChildPageName = Page.Page.ToString();
            //this.MessageLabel.Text = ChildPageName;

            if (Session["SponsorId"].ToString() == "0")
            {
                //this.LogoutButton.Visible = false;
                RighMenue.Visible = false;
            }

            if (Session["SponsorId"].ToString() == "0" && ChildPageName != "ASP.sponsors_forgotpassword_aspx" && ChildPageName != "ASP.sponsors_test_aspx" && ChildPageName != "ASP.sponsors_default_aspx")
            {
                Response.Redirect("~/Sponsors/Default.aspx");
            }


        }

        protected void LogoutButton_Click(object sender, EventArgs e)
        {
            Nivdal.Old_App_Code.Sponser.SponsorLogout();
            Response.Redirect("~/Sponsors/Default.aspx");

        }
    }
}